package lessonWork;

import java.util.InputMismatchException;
import java.util.Scanner;

public class work8_9 {
    public static void main(String[] args) {
        try {
            int[] in=new int[5];
            Scanner sc = new Scanner(System.in);

//            String s=sc.next();
//            String[] split = s.split(",");
//            for (int i = 0; i < 5; i++) {
//                in[i]=Integer.parseInt(split[i]);
//            }
            System.out.println("请输入数组长度，最大5个");
            int length = sc.nextInt();
            System.out.println("请输入整数");
            for (int i = 0; i < length; i++) {
                in[i]=sc.nextInt();
            }
        }catch (InputMismatchException e){
            System.out.println("请输入整数");
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println("下标越界");

        }
    }
}
